var sqlMap = {
    user: {
        add: 'insert into user (username, password, power) values (?,?,?)',
        select: 'select * from user',
        del: 'delete from user',
        update: 'update user set'
    },
    main: {
        select: 'select * from main where keywords is not null order by news_id desc',
        add: 'insert into main (title, source, url, publish_time, category, \
            content, keyword, sentiment) values (?,?,?,?,?,?,?,?)',
        // edit: 'update main set id = ?, title = ?, source = ?, url = ?, publish_time = ?, category = ?, content = ?, keyword = ?, sentiment = ? where id = ?'
        edit: 'update main set ',
        simple_search: 'select * from main where keywords is not null',
        advanced_search: 'select * from main where keywords is not null',
        topic_select: 'select * from main',

        //可视化
        newsview: 'select title, source, url, publish_time, category from main ',
        topic_hotwords: 'select * from ',
        total_inventory: 'select count(news_id) as a from main ',//总
        today_inventory: 'select count(news_id) as b from main ',//今天
        month_inventory: 'select count(news_id) as c from main ',//本月
        yesterday_inventory: 'select count(news_id) as d from main ',//昨天
        daycount: 'select source,date_format(?,\'%Y-%m-%d\') as time,count(news_id) as newscount from main where publish_time>=? and publish_time<? group by source'
        //
    },
    topic: {
        select: 'select * from topic',
        topic_select: 'select specialtopic from topic  ',
        add: 'insert into topic(specialtopic) values(?)'
    },
    main_topic: {
        select: 'select * from main_topic',
        add: 'insert into main_topic(news_id, s_topic_id) values'
    }
}


module.exports = sqlMap;